<include file="public@header"/>
</head>
<body>
<div class="wrap">
    <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="">
        <div class="form-group">
            <label for="input-company" class="col-sm-2 control-label"><span class="form-required">*</span>公司名称</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" id="input-company" required name="company">
            </div>
        </div>
        <div class="form-group">
            <label for="select-second_cate" class="col-sm-2 control-label"><span class="form-required">*</span>行业类别</label>
            <div class="col-md-6 col-sm-10">
                <div class="col-xs-6">
                    <div class="row">
                        <select class="form-control" name="category_first" id="first_cate">
                            <option value="1">一类</option>
                            <option value="2">二类</option>
                            <option value="3">私募</option>
                        </select>
                    </div>
                </div>
                <div class="col-xs-6">
                    <div class="row">
                        <select class="form-control small" name="cid" id="second_cate">
                        </select>
                    </div>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label for="input-corporation" class="col-sm-2 control-label"><span class="form-required">*</span>法人代表</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" id="input-corporation" required name="corporation">
            </div>
        </div>
        <div class="form-group">
            <label for="input-registered_capital" class="col-sm-2 control-label"><span class="form-required">*</span>注册资金</label>
            <div class="col-md-6 col-sm-10 input-group" style="padding: 0 15px;">
                <input type="number" class="form-control" id="input-registered_capital" required name="registered_capital">
                <span class="input-group-addon">万元</span>
            </div>
        </div>
        <div class="form-group">
            <label for="input-currency" class="col-sm-2 control-label"><span class="form-required">*</span>货币种类</label>
            <div class="col-md-6 col-sm-10">
                <input class="form-control" type="text" required value="{$defCurrency.name}"
                       placeholder="请选择币种" onclick="doSelectLayerApi(this);" data-is_full="true"
                       data-url="{:url('/api/resource/currency/select_h5')}" data-id="input-currency" name="layer_temp[1]"
                       readonly/>
                <input class="form-control" type="hidden" value="{$defCurrency.id}" name="currency"
                       id="input-currency"/>
            </div>
        </div>
        <div class="form-group">
            <label for="input-regtime" class="col-sm-2 control-label"><span class="form-required">*</span>成立日期</label>
            <div class="col-md-6 col-sm-10">
                <input class="form-control" required max="{:date('Y-m-d')}" type="date" name="regtime" id="input-regtime"
                       value="{:date('Y-m-d')}">
            </div>
        </div>
        <div class="form-group">
            <label for="select-area" class="col-sm-2 control-label"><span class="form-required">*</span>注册地区</label>
            <div class="col-md-6 col-sm-10">
                <select class="form-control" id="select-area" name="area" required>
                    <option>请选择</option>
                    <volist name="areaslist" id="vo">
                        <option value="{$vo.areaid}">{$vo.name}</option>
                    </volist>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="input-address" class="col-sm-2 control-label">注册地址</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" id="input-address" name="address">
            </div>
        </div>
        <div class="form-group">
            <label for="input-business" class="col-sm-2 control-label">主营业务</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" id="input-business" name="business">
            </div>
        </div>
        <div class="form-group">
            <label for="input-phone" class="col-sm-2 control-label"><span class="form-required">*</span>联系电话</label>
            <div class="col-md-6 col-sm-10">
                <input type="tel" class="form-control" id="input-phone" required name="phone">
            </div>
        </div>
        <div class="form-group">
            <label for="input-email" class="col-sm-2 control-label"><span class="form-required">*</span>邮箱</label>
            <div class="col-md-6 col-sm-10">
                <input type="email" class="form-control" id="input-email" required name="email">
            </div>
        </div>
        <div class="form-group">
            <label for="input-situation" class="col-sm-2 control-label"><span class="form-required">*</span>公司情况</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" id="input-situation" required name="situation">
            </div>
        </div>
        <div class="form-group">
            <label for="input-manager" class="col-sm-2 control-label"><span class="form-required">*</span>负责人</label>
            <div class="col-md-6 col-sm-10">
                <input class="form-control" type="text" required value="{$default.name|default=''}"
                       placeholder="请选择负责人" onclick="doSelectLayerApi(this);" data-is_full="true"
                       data-url="{:url('/api/department/user/select_h5')}" data-id="input-manager" name="layer_temp[3]"
                       readonly/>
                <input class="form-control" type="hidden" value="" name="manager"
                       id="input-manager"/>
            </div>
        </div>
        <div class="form-group">
            <label for="input-createtime" class="col-sm-2 control-label">录入时间</label>
            <div class="col-md-6 col-sm-10">
                <input type="datetime-local" class="form-control" id="input-createtime" max="{:date('Y-m-d\\TH:i')}" value="{:date('Y-m-d\\TH:i')}" required name="createtime">
            </div>
        </div>
        <div class="form-group">
            <label for="input-record_type" class="col-sm-2 control-label">备案类型</label>
            <div class="col-md-6 col-sm-10 ">
                <input type="radio" value="1" name="record_type"/> 区域
                <input type="radio" value="2" id="input-record_type" name="record_type"/> 全国
            </div>
        </div>
        <div class="form-group">
            <label for="input-record_time" class="col-sm-2 control-label">备案时间</label>
            <div class="col-md-6 col-sm-10">
                <input type="date" class="form-control" id="input-record_time" max="{:date('Y-m-d')}" value="{:date('Y-m-d')}" required name="record_time">
            </div>
        </div>
        <div class="form-group">
            <label for="input-nature" class="col-sm-2 control-label"><span class="form-required">*</span>客户性质</label>
            <div class="col-md-6 col-sm-10">
                <input class="form-control" type="text" required value="{$default.name|default=''}"
                       placeholder="请选择客户性质" onclick="doSelectLayerApi(this);" data-is_full="true"
                       data-url="{:url('/api/resource/cate/select_h5',['type'=>1])}" data-id="input-nature" name="layer_temp[4]"
                       readonly/>
                <input class="form-control" type="hidden" value="" name="nature"
                       id="input-nature"/>
            </div>
        </div>
        <div class="form-group">
            <label for="input-price" class="col-sm-2 control-label">价格</label>
            <div class="col-md-6 col-sm-10" style="padding: 0 15px;">
                <div class=" input-group">
                    <span class="input-group-addon">¥</span>
                    <input type="number" class="form-control" id="input-price" name="price">
                    <span class="input-group-addon">万元</span>
                </div>
                <p class="help-block">（两位小数）</p>
            </div>
        </div>
        <div class="form-group">
            <label for="textarea-remark" class="col-sm-2 control-label">备注</label>
            <div class="col-md-6 col-sm-10">
                <textarea name="remark" class="form-control" id="textarea-remark" rows="3"></textarea>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $("#first_cate").change(function(){
            var selected_id = $("#first_cate").val();
            $.ajax({
                url:"{:url('/api/business/cate/lists')}",
                headers:{
                            'XX-Token': header.token,
                            'XX-Device-Type': header.device
                        },
                data: {id : selected_id},
                async:true,
                type:'GET',
                contentType:"application/json",
                dataType:"json",
                success:function(data){
                    if(data.code > 20000 && data.code <30000) {
                        logout();
                    }
                    $("#second_cate").html("");
                    $.each(data.data,function (k,p){
                        $("#second_cate").append("<option value='"+p.id+"'>"+p.name+"</option>");
                    });
                    
                }
            })
        });
        $("#first_cate").change();
    });
</script>
</body>
</html>